﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Empleado.aspx.cs" Inherits="ForrajeriaFRONT.ABM.Empleado" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
        }
        .style2
        {
            height: 22px;
        }
        .style3
        {
            height: 24px;
        }
        .style4
        {
            width: 134px;
        }
        .style5
        {
            width: 100%;
        }
        .style6
        {
            text-align: center;
        }
    .style7
    {
        color: #000000;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="panelInicio" runat="server" >
            <table class="style5">
                <tr>
                    <td class="style6">
                        <asp:Button ID="btnNuevo2" runat="server" onclick="btnNuevo2_Click" 
                            Text="Nuevo" />
                    </td>
                    <td class="style6">
                        <asp:Button ID="btnBuscar3" runat="server" onclick="btnBuscar3_Click" 
                            Text="Buscar" />
                    </td>
                    
                    </td>
                    <td class="style6">
                        <asp:Button ID="btnInforme" runat="server" onclick="btnInforme_Click" 
                            Text="Generar Informe" CausesValidation="False" />
                    </td>
                </tr>
            </table>
            <td class="style6">
                        </asp:Panel>
    <asp:Panel ID="panelCarga" runat="server">
      <div id="carga">
        <asp:ValidationSummary ID="valSumary" runat="server" ForeColor="Red" 
              ValidationGroup="gGuardar" />
        <table id="tablaDatos" cellpadding="10" cellspacing="10" runat="server">
           <tbody>
            <tr>
                <td colspan="2"><b>Datos Empleado:</b></td>
                <td colspan="2"><b>Datos Domicilio:</b></td>
            </tr>
            <tr>
                <td class="style7">Nombre:</td>
                <td class="style3"><asp:TextBox ID="txtNombre" runat="server" Text="" MaxLength="50" Width="150px"></asp:TextBox>
                </td>
                <td class="style4">Provincia:</td>
                <td class="style2">
                    <b>
                    <asp:DropDownList ID="ddlProvincia" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="ddlProvincia_SelectedIndexChanged" Width="150px">
                    </asp:DropDownList>
                    </b>
                </td>
            </tr>
            <tr>
                <td class="style7">Apellido:</td>
                <td class="style3"><asp:TextBox ID="txtApellido" runat="server" Text="" MaxLength="50" Width="150px"></asp:TextBox>
                </td>
                <td class="style4">Localidad:</td>
                <td class="style2">
                    <asp:DropDownList ID="ddlLocalidad" runat="server" 
                        Width="150px">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="ddlLocalidad" ErrorMessage="Debe seleccionar una Localidad" 
                        ForeColor="Red" ValidationGroup="gGuardar">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style7">Tipo de Documento:</td>
                <td class="style3"><asp:DropDownList ID="ddlTipoDocumento" runat="server" Width="150px"></asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="ddlTipoDocumento" ErrorMessage="tipo de Documento" 
                        ForeColor="Red" ValidationGroup="gGuardar">*</asp:RequiredFieldValidator>
                </td>
                <td class="style4">Calle:</td>
                <td class="style2"><b>
                    <asp:TextBox ID="txtCalle" runat="server" MaxLength="50" Text="" Width="150px"></asp:TextBox>
                    </b>
                </td>
            </tr>
            <tr>
                <td class="style7">Numero de Documento:</td>
                <td class="style3"><asp:TextBox ID="txtNroDocumento" runat="server" Text="" Width="150px"  ></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtNroDocumento" 
                        ErrorMessage="Debe ingresar un numero de documento" ForeColor="Red" 
                        ValidationGroup="gGuardar">*</asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" 
                        ControlToValidate="txtNroDocumento" 
                        ErrorMessage="Debe ingresar un documento mayor a cero" ForeColor="Red" 
                        MaximumValue="100000000" MinimumValue="0" Type="Integer" 
                        ValidationGroup="gGuardar">*</asp:RangeValidator>
                </td>
                <td class="style4">Numero:</td>
                <td class="style2"><asp:TextBox ID="txtNumeroCalle" runat="server" Text="" MaxLength="10" Width="150px"></asp:TextBox>
                    <asp:RangeValidator ID="RangeValidator2" runat="server" 
                        ControlToValidate="txtNumeroCalle" 
                        ErrorMessage="Debe ingresar un numero positivo en el numero de la direccion" 
                        ForeColor="Red" MaximumValue="100000" MinimumValue="0" Type="Integer" 
                        ValidationGroup="gGuardar">*</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td class="style7">Telefono:</td>
                <td class="style3"><asp:TextBox ID="txtTelefono" runat="server" Text="" MaxLength="15" Width="150px"></asp:TextBox>
                </td>
                <td class="style4">Piso:</td>
                <td><asp:TextBox ID="txtPiso" runat="server" Text="" MaxLength="2" Width="150px"></asp:TextBox></td>            
            </tr>
            <tr>
                <td class="style7" colspan="2">
                    <asp:Label ID="mensaje" runat="server" text="" />
                </td>
                <td class="style4">Departamento:</td>
                <td><asp:TextBox ID="txtDepartamento" runat="server" Text="" MaxLength="2" Width="150px"></asp:TextBox></td>
                
            </tr>
        </tbody>
        </table>
    </div>
    <div id="botones" class="botones">
        <table cellpadding="10" cellspacing="10">
            <tbody>
                 <tr>
                    <td>
                        <asp:Button ID="btnBuscar" Text="Inicio" runat="server" 
                            OnClick="btnBuscar_Click" CausesValidation="false"/>
                    </td>
                    <td>
                        <asp:Button ID="btnNuevo" Text="Nuevo" runat="server" onclick="btnNuevo_Click" CausesValidation="false"/>
                    </td>
                    <td>
                        <asp:Button ID="btnEditar" Text="Editar" runat="server" onclick="btnEditar_Click" CausesValidation="false"/>
                    </td>
                    <td>
                        <asp:Button ID="btnBorrar" Text="Eliminar" runat="server" OnClick="btnBorrar_Click" CausesValidation="false" />
                    </td>
                    <td>
                        <asp:Button ID="btnGuardar" Text="Guardar" runat="server" 
                         onclick="btnGuardar_Click" ValidationGroup="gGuardar"/>
                    </td>
                    <td>
                        <asp:Button ID="btnCancelar" runat="server" onclick="btnCancelar_Click" 
                            Text="Cancelar" />
                    </td>
                 </tr>
            </tbody>
        </table>
        
    </div>
    </asp:Panel>
    <asp:Panel ID="panelBusca" runat="server" >
        <table class="style1">
            <tr>
                <td class="style7">
                    Nombre:
                </td>
                <td class="style4">
                    <asp:TextBox ID="txtNombreLike" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    Apellido:
                </td>
                <td>
                    <asp:TextBox ID="txtApellidoLike" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    Localidad</td>
                <td style="margin-left: 40px">
                    <asp:DropDownList ID="ddlLocal" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style7">
                    Numero de documento</td>
                <td class="style4">
                    <asp:TextBox ID="txtNroDoc" runat="server"></asp:TextBox>
                    <asp:RangeValidator ID="RangeValidator3" runat="server" 
                        ControlToValidate="txtNroDoc" 
                        ErrorMessage="El numero de documento debe ser un numero positivo menor a 100000000" 
                        ForeColor="Red" MaximumValue="100000000" MinimumValue="0" Type="Integer" 
                        ValidationGroup="gBuscar">*</asp:RangeValidator>
                </td>
                <td class="style7">
                    Provincia</td>
                <td>
                    <asp:DropDownList ID="ddlProv" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="ddlProv_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    <asp:Button ID="btnBuscarTodos" runat="server" onclick="btnBuscarTodos_Click" 
                        Text="Buscar" ValidationGroup="gBuscar" />
                </td>
            </tr>
            <tr>
                <td class="style3" colspan="6">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                        ValidationGroup="gBuscar" ForeColor="Red" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="grdEmpleados" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="Codigo,TipoDocumento,NroDocumento,Localidad,Dpto,Piso" 
            onselectedindexchanged="grdEmpleados_SelectedIndexChanged" 
            onselectedindexchanging="grdEmpleados_SelectedIndexChanging" 
            CellPadding="4" EmptyDataText="No hay Datos para Mostrar" ForeColor="#333333" 
            GridLines="None" onrowdeleting="grdEmpleados_RowDeleting" 
            onrowediting="grdEmpleados_RowEditing1">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Nombre" HeaderText="Nombre" />
                <asp:BoundField DataField="Apellido" HeaderText="Apellido" />
                <asp:BoundField DataField="Telefono" HeaderText="Telefono" />
                <asp:BoundField DataField="Estado" HeaderText="Localidad" />
                <asp:BoundField DataField="Calle" HeaderText="Calle" />
                <asp:BoundField DataField="NroCalle" HeaderText="Numero Calle" />
                <asp:BoundField DataField="Codigo" HeaderText="Codigo" Visible="False" />
                <asp:BoundField DataField="TipoDocumento" HeaderText="TipoDocumento" 
                    Visible="False" />
                <asp:BoundField DataField="NroDocumento" HeaderText="NroDocumento" 
                    Visible="False" />
                <asp:BoundField DataField="Localidad" HeaderText="IdLocalidad" 
                    Visible="False" />
                <asp:BoundField DataField="Dpto" HeaderText="Dpto" Visible="False" />
                <asp:BoundField DataField="Piso" HeaderText="Piso" Visible="False" />
                <asp:CommandField ButtonType="Image" CancelText="" 
                    DeleteImageUrl="~/Images/borrarABM.jpg" EditText="" HeaderText="Quitar" 
                    InsertText="" NewText="" SelectText="" ShowDeleteButton="True" 
                    UpdateImageUrl="~/Images/borrarABM.jpg" UpdateText="" />
                <asp:CommandField ButtonType="Image" CancelText="" DeleteText="" EditText="" 
                    HeaderText="Editar" InsertText="" NewText="" 
                    SelectImageUrl="~/Images/modificarABM.jpg" ShowSelectButton="True" 
                    UpdateImageUrl="~/Images/modificarABM.jpg" UpdateText="" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <br />
        
        <br />
        <br />
        
</asp:Panel>
<asp:Panel ID="panelInforme" runat="server">
            <table class="style5">
                <tr>
                    <td>
                        Monto Vendido Minimo:
                    </td>
                    <td>
                        <asp:TextBox ID="txtMontoVendido" runat="server"></asp:TextBox>
                        <asp:RangeValidator ID="RangeValidator4" runat="server" 
                            ControlToValidate="txtMontoVendido" 
                            ErrorMessage="Ingrese un Valor para Monto Valido" ForeColor="Red" 
                            MaximumValue="1000000000" MinimumValue="0" Type="Double" 
                            ValidationGroup="gInforme">*</asp:RangeValidator>
                    </td>
                    <td>
                        Provincia:</td>
                    <td>
                        <asp:DropDownList ID="ddlProvinciaInforme" runat="server" AutoPostBack="True" 
                            onselectedindexchanged="ddlProvinciaInforme_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        Localidad</td>
                    <td colspan="2">
                        <asp:DropDownList ID="ddlLocalidadInforme" runat="server">
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:Button ID="btnGenerarInforme" runat="server" 
                            onclick="btnGenerarInforme_Click" Text="Generar Informe" 
                            ValidationGroup="gInforme" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:GridView ID="grdInforme" runat="server" AutoGenerateColumns="False" 
                            CellPadding="4" ForeColor="#333333" GridLines="None">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:BoundField DataField="Codigo" HeaderText="Codigo" Visible="False" />
                                <asp:BoundField DataField="Nombre" HeaderText="Nombre" />
                                <asp:BoundField DataField="Apellido" HeaderText="Apellido" />
                                <asp:BoundField DataField="Localidad" HeaderText="Id_Localidad" 
                                    Visible="False" />
                                <asp:BoundField DataField="LocalidadNom" HeaderText="Localidad" />
                                <asp:BoundField DataField="Provincia" HeaderText="Id_Provincia" 
                                    Visible="False" />
                                <asp:BoundField DataField="ProvinciaNom" HeaderText="Provincia" />
                                <asp:BoundField DataField="MontoVendido" HeaderText="Monto Vendido" />
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                        <asp:ValidationSummary ID="ValidationSummary2" runat="server" ForeColor="Red" 
                            ValidationGroup="gInforme" />
                    </td>
                </tr>
            </table>
            <br />
        </asp:Panel>
</asp:Content>

